# $Id: PKGBUILD 160075 2012-05-29 22:01:31Z eric $
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=icewm
pkgver=1.3.7
pkgrel=3
pkgdesc="A Window Manager designed for speed, usability, and consistency"
arch=('i686' 'x86_64')
url="http://www.icewm.org/"
license=('LGPL')
depends=('libxrandr' 'libxft' 'libsm' 'libxinerama' 'gdk-pixbuf2')
makedepends=('xorg-mkfontdir')
source=(http://downloads.sourceforge.net/sourceforge/icewm/${pkgname}-${pkgver}.tar.gz
        use_ICEWM_deprecated.patch ignore_workarea_hints.patch no_proc_acpi.patch 
        wmclient.patch icewm-cpustatus.patch)
sha1sums=('ce8d86190e275dc7db2d8c28472a579264120803'
          'ac8f352ba5ee33e19ce75fdeed890361550e125a'
          '49ca37ae41290f17a71a177b1f774235f91d79f1'
          'a47fb4191f30b8f42a6bd90ca5d7941bb3d65338'
          'd16b4b3ab269a657e735e343833973d000c0b35b'
          '0f4a02153496dadd26742f6bd3bdc166d7eafaed')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -p1 -i "${srcdir}/use_ICEWM_deprecated.patch"
  patch -p1 -i "${srcdir}/ignore_workarea_hints.patch"
  patch -p1 -i "${srcdir}/no_proc_acpi.patch"
  patch -p1 -i "${srcdir}/wmclient.patch"
  patch -p2 -i "${srcdir}/icewm-cpustatus.patch"
  LIBS+="-lfontconfig" ./configure --prefix=/usr --sysconfdir=/etc \
    --enable-shaped-decorations --enable-gradients
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install install-man install-docs install-desktop
}
